<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <h1>注册步骤</h1>
    身高: <input type="text" class="height" />
    <button class="pre">上一步</button>
    <button class="submit">提交</button>
    <script>
      let heightEle = document.querySelector(".height");
      document.querySelector(".pre").onclick = function () {
        window.location.href = "./a.html";
      };
      if (sessionStorage.getItem("height")) {
        heightEle.value = sessionStorage.getItem("height");
      }
      document.querySelector(".submit").onclick = function () {
        let height = heightEle.value;
        sessionStorage.setItem("height", height);
      };
    </script>
  </body>
</html>
